#ifndef __TEST4_H_
#define __TEST4_H_

#include <stdio.h>
#include <stdlib.h>

typedef char    data_t;
#define Nu      5
#define right   0
#define err     1

// 顺序队列
typedef struct
{
    data_t data[Nu];
    int front, rear; //定义顺序队列的头尾
} sequence_t;

typedef struct Qnode
{
    data_t data;
    struct Qnode *next;
} qnode_t;
typedef struct
{
    qnode_t *front,*rear;
    int len;
} linkqueue_t;


void test4(void);
void InitSequence(sequence_t *sequence);
int InsertSequence(sequence_t *sequence, data_t data);
int GetoutSequence(sequence_t *sequence, data_t *data);
int ArrangeSequence(sequence_t *sequence);

int InsertLoopSequence(sequence_t *sequence, int data);
int GetoutLoopSequence(sequence_t *sequence, int *data);

linkqueue_t *CreatListSequence(void);
int InsertListSequence(linkqueue_t *linkq, int data);
int GetOutListSequence(linkqueue_t *linkq, int *data);
void PrintAllLinkqueue(linkqueue_t *linkq);
#endif
